﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Valhalla
{
    public struct ProcessorOperation
    {
        public ProcessorOperation( string formatString, int extraByteCount, Operation operation, Operand firstOperand, Operand secondOperand, byte embeddedValue, Flags affectedFlags, Flags setFlags, Flags clearFlags, byte baseCycleCount, byte conditionalCycleCount)
        {
            FormatString = formatString;
            ExtraByteCount = extraByteCount;
            Operation = operation;
            FirstOperand = firstOperand;
            SecondOperand = secondOperand;
            EmbeddedValue = embeddedValue;
            AffectedFlags = affectedFlags;
            SetFlags = setFlags;
            ClearFlags = clearFlags;
            BaseCycleCount = baseCycleCount;
            ConditionalCycleCount = conditionalCycleCount;
        }
        public string FormatString;
        public int ExtraByteCount;
        public Operation Operation;
        public Operand FirstOperand;
        public Operand SecondOperand;
        public Flags AffectedFlags, SetFlags, ClearFlags;
        public byte EmbeddedValue;
        public byte BaseCycleCount;
        public byte ConditionalCycleCount;

        public static ProcessorOperation Invalid = new ProcessorOperation(null, 0, Operation.Invalid, Operand.None, Operand.None, 0, Flags.None, Flags.None, Flags.None, 4, 0);

    }
    [Flags]
    public enum Flags : byte
    {
        Zero = 0x80,
        Negation = 0x40,
        HalfCarry = 0x20,
        Carry = 0x10,
        All = 0xF0,
        None = 0x00
    }

    [Flags]
    public enum DisassembleFlags
    {
        Instruction = 0,
        Offset = 1,
        RawData = 2,
        Default = 3
    }
}
